package org.wu.spring.orm.integration.compare.infrastructure.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.beetl.sql.annotation.entity.AutoID;
import org.sagacity.sqltoy.config.annotation.Column;
import org.sagacity.sqltoy.config.annotation.Entity;
import org.sagacity.sqltoy.config.annotation.Id;
import org.wu.framework.lazy.orm.core.stereotype.*;

import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * describe sys_user
 *
 * @author Jia wei Wu
 * @date 2024/02/28 11:27 上午
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureEntity
 **/
@Data
//@Accessors(chain = true) // todo 与beetlsql 反射方法不兼容
@LazyTable(tableName = "sys_user", comment = "") // lazy
@TableName(value = "sys_user", autoResultMap = true)// mybatis  autoResultMap 处理json数据
@Entity(tableName = "sys_user") // sqltoy
@Schema(title = "sys_user", description = "")
@com.mybatisflex.annotation.Table(value = "sys_user") // flex
@com.easy.query.core.annotation.Table("sys_user") // easy-query
@cn.mybatis.mp.db.annotations.Table("sys_user") // mybatis-mp

// jpa
@jakarta.persistence.Entity// jpa
@jakarta.persistence.Table(name = "sys_user") //jpa
@net.hasor.dbvisitor.mapping.Table("sys_user") // dbvisitor
//@SQLInsert(sql = "INSERT IGNORE INTO  sys_user (column_name, create_time, id, is_deleted, password, scope, status, update_time,username) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", check = ResultCheckStyle.COUNT)


@org.beetl.sql.annotation.entity.Table(name = "sys_user")// beetlsql
@com.dream.system.annotation.Table("sys_user") // dream_orm

@javax.persistence.Table(name = "sys_user") // hammer-sqldb
public class SysUserDO implements Serializable {


    /**
     * 额外字段
     */
    @Schema(description = "额外字段", name = "columnName", example = "")
    @LazyTableField(name = "column_name", comment = "额外字段", columnType = "varchar(255)")
    @Column(name = "column_name", comment = "额外字段")// sqltoy
    @jakarta.persistence.Column(name = "column_name", columnDefinition = "额外字段")// jpa
    @org.beetl.sql.annotation.entity.Column(value = "column_name")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "column_name") // db_visitor
    @com.dream.system.annotation.Column("column_name") // dream_orm
    private String columnName;
    /**
     * 创建时间
     */
    @Schema(description = "创建时间", name = "createTime", example = "")
    @LazyTableField(name = "create_time", comment = "创建时间", defaultValue = "CURRENT_TIMESTAMP", upsertStrategy = LazyFieldStrategy.NEVER, columnType = "datetime", extra = " on update CURRENT_TIMESTAMP")
    @Column(name = "create_time", comment = "创建时间", defaultValue = "CURRENT_TIMESTAMP")// sqltoy
    @jakarta.persistence.Column(name = "create_time", columnDefinition = "创建时间")// sqltoy
    @org.beetl.sql.annotation.entity.Column(value = "create_time")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "create_time") // db_visitor
    @com.dream.system.annotation.Column("create_time") // dream_orm
    private LocalDateTime createTime;

    /**
     * 用户ID
     */
    @Schema(description = "用户ID", name = "id", example = "")
    @LazyTableFieldId(name = "id", comment = "用户ID")
    @Id// sqltoy
    @Column(name = "id")// sqltoy
    @cn.mybatis.mp.db.annotations.TableId // mybatis-mp
    @jakarta.persistence.Id // jpa
    @jakarta.persistence.Column(name = "id")// jpa
    @AutoID
    @org.beetl.sql.annotation.entity.Column(value = "id")// beetlsql
    @com.dream.system.annotation.Column("id") // dream_orm
    @com.dream.system.annotation.Id() // dream_orm
    @javax.persistence.Id()
    private Long id;

    /**
     * null
     */
    @Schema(description = "null", name = "isDeleted", example = "")
    @LazyTableField(name = "is_deleted", comment = "null", columnType = "tinyint(1)")
    @Column(name = "is_deleted", comment = "null")// sqltoy
    @jakarta.persistence.Column(name = "is_deleted", columnDefinition = "null")// jpa
    @org.beetl.sql.annotation.entity.Column(value = "is_deleted")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "is_deleted") // db_visitor
    @com.dream.system.annotation.Column("is_deleted") // dream_orm
    private Boolean isDeleted;

    /**
     * 密码
     */
    @Schema(description = "密码", name = "password", example = "")
    @LazyTableField(name = "password", comment = "密码", columnType = "varchar(255)")
    @Column(name = "password", comment = "密码")// sqltoy
    @jakarta.persistence.Column(name = "password", columnDefinition = "密码")// jpa
    @org.beetl.sql.annotation.entity.Column(value = "password")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "password") // db_visitor
    @com.dream.system.annotation.Column("password") // dream_orm
    private String password;

    /**
     * null
     */
    @Schema(description = "null", name = "scope", example = "")
//    @LazyTableFieldUnique(name = "scope", comment = "null", columnType = "varchar(255)")
    @LazyTableField(name = "scope", comment = "null", columnType = "varchar(255)")
    @Column(name = "scope", comment = "null")// sqltoy
    @jakarta.persistence.Column(name = "scope", columnDefinition = "null")// jpa
    @org.beetl.sql.annotation.entity.Column(value = "scope")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "scope") // db_visitor
    @com.dream.system.annotation.Column("scope") // dream_orm
    private String scope;

    /**
     * 状态
     */
    @Schema(description = "状态", name = "status", example = "")
    @LazyTableField(name = "status", comment = "状态", columnType = "tinyint(1)")
    @Column(name = "status", comment = "状态")// sqltoy
    @jakarta.persistence.Column(name = "status", columnDefinition = "状态")// jpa
    @org.beetl.sql.annotation.entity.Column(value = "status")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "status") // db_visitor
    @com.dream.system.annotation.Column("status") // dream_orm
    private Boolean status;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间", name = "updateTime", example = "")
    @LazyTableField(name = "update_time", comment = "更新时间", defaultValue = "CURRENT_TIMESTAMP", upsertStrategy = LazyFieldStrategy.NEVER, columnType = "datetime", extra = " on update CURRENT_TIMESTAMP")
    @Column(name = "update_time", comment = "更新时间", defaultValue = "CURRENT_TIMESTAMP")// sqltoy
    @jakarta.persistence.Column(name = "update_time", columnDefinition = "更新时间")// jpa
    @org.beetl.sql.annotation.entity.Column(value = "update_time")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "update_time") // db_visitor
    @com.dream.system.annotation.Column("update_time") // dream_orm
    private LocalDateTime updateTime;

    /**
     * 用户名
     */
    @Schema(description = "用户名", name = "username", example = "")
//    @LazyTableFieldUnique(name = "username", comment = "用户名", columnType = "varchar(255)")
    @LazyTableField(name = "username", comment = "用户名", columnType = "varchar(255)")
    @Column(name = "username", comment = "用户名")// sqltoy
    @jakarta.persistence.Column(name = "username", columnDefinition = "用户名")// jpa
    @org.beetl.sql.annotation.entity.Column(value = "username")// beetlsql
    @net.hasor.dbvisitor.mapping.Column(name = "username") // db_visitor
    @com.dream.system.annotation.Column("username") // dream_orm
    private String username;

}